<?php if (!defined('THINK_PATH')) exit();?> <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>玩家列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/game/Public/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/game/Public/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/game/Public/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/game/Public/admin/css/animate.css" rel="stylesheet">
    <link href="/game/Public/admin/css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>玩家列表</h5>
                        <div class="ibox-tools">                           
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row ">
                        <form method="get" action="<?php echo U('Admin/Gamer/gamerList');?>">
                            <div class="col-sm-3 m-b-xs">
                                <select class="input-sm form-control input-s-sm inline" name="keywords">
                                    <option value="">请选择搜索字段</option>
                                    <option value="gamer_id" <?php if(($keywords) == "gamer_id"): ?>selected='selected'<?php endif; ?>>ID</option>
                                    <option value="openid" <?php if(($keywords) == "openid"): ?>selected='selected'<?php endif; ?>>玩家ID</option>
                                    <option value="nickname" <?php if(($keywords) == "nickname"): ?>selected='selected'<?php endif; ?>>昵称</option>
                                    <!-- <option value="phone" <?php if(($keywords) == "phone"): ?>selected='selected'<?php endif; ?>>手机号</option> -->
                                    
                                </select>
                            </div>
                            <div class="col-sm-4">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入关键词" class="input-sm form-control" value="<?php echo ($keyvalue); ?>" name="keyvalue"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                            </div>
                        </form>
                        </div>
                    </div>
                    <div class="ibox-content">

                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>玩家ID</th>
                                    <th>昵称</th>
                                    <!-- <th>手机号</th> -->
                                    <th>初始房卡数</th>
                                    <th>充值总数</th>
                                    <th>消费总数</th>
                                    <th>游戏总局数</th>
                                    <th>注册时间</th>
                                    <!-- <th>状态</th>
                                    <th>操作</th> -->
                                </tr>
                            </thead>
                            <tbody>
                            <?php if(empty($adminList)): ?><tr>
                                <td colspan="12">没有相关数据！</td>
                            </tr><?php endif; ?>
                            <?php if(is_array($adminList)): foreach($adminList as $key=>$v): ?><tr>
                                    <td><?php echo ($v["gamer_id"]); ?></td>
                                    <td><?php echo ($v["openid"]); ?></td>
                                    <td><?php echo ($v["nickname"]); ?></td>
                                    <!-- <td><?php echo ($v["phone"]); ?></td> -->
                                    <td><?php echo ($v["init_pay"]); ?></td>
                                    <td>
                                    <?php if(($v["total_pay"]) == "0"): ?>0<?php else: ?>
                                    <a href="<?php echo U('Admin/Gamer/payList');?>?keywords=openid&keyvalue=<?php echo ($v["openid"]); ?>"><?php echo ($v["total_pay"]); ?></a><?php endif; ?>
                                    </td>
                                    <td>
                                    <?php if(($v["total_consume"]) == "0"): ?>0<?php else: ?>
                                    <a href="<?php echo U('Admin/Gamer/consumeList');?>?keywords=openid&keyvalue=<?php echo ($v["openid"]); ?>"><?php echo ($v["total_consume"]); ?></a><?php endif; ?>
                                    </td>
                                    <td>
                                    <?php if(($v["total_play"]) == "0"): ?>0<?php else: ?>
                                    <a href="<?php echo U('Admin/Gamer/recordList');?>?keywords=openid&keyvalue=<?php echo ($v["openid"]); ?>"><?php echo ($v["total_play"]); ?></a><?php endif; ?>
                                    </td>
                                    <td><?php echo ($v["addtime"]); ?></td>
                                    <!-- <td><?php switch($v["status"]): case "0": ?><span class="cgreen">正常</span><?php break;?>
                                    <?php case "1": ?><span class="cred">封停</span><?php break; endswitch;?></td>
                                    <td><a href="#" onclick="blacklist(<?php echo ($v["gamer_id"]); ?>,<?php echo ($v["status"]); ?>)"><?php switch($v["status"]): case "0": ?>封停<?php break;?>
                                    <?php case "1": ?>解封<?php break; endswitch;?></a></td> -->
                                </tr><?php endforeach; endif; ?> 
                            </tbody>
                                
                        </table>
                        <?php echo ($page); ?>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <!-- 全局js -->
    <script src="/game/Public/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/game/Public/admin/js/bootstrap.min.js?v=3.3.6"></script>



    <!-- Peity -->
    <script src="/game/Public/admin/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- 自定义js -->
    <script src="/game/Public/admin/js/content.js?v=1.0.0"></script>


    <!-- iCheck -->
    <script src="/game/Public/admin/js/plugins/iCheck/icheck.min.js"></script>

    <!-- Peity -->
    <!-- <script src="/game/Public/admin/js/demo/peity-demo.js"></script> -->

    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });

    function blacklist(gamer_id,status){
        if (status=='1') {
            var act='解封';
            var status=0;
        }else{
            var act='封停';
            var status=1;
        }
     if(confirm("确定要"+act+"该代理吗？")){
     $.ajax({
             type:'post',
             url:"<?php echo U('Admin/Gamer/blacklist');?>?gamer_id="+gamer_id+"&status="+status,
             dataType:'json',
             success:function(data){ 
                if (data=='success') {
                    alert(act+'成功！');
                    window.location.href="<?php echo U('Admin/Gamer/gamerList');?>";
                }else{
                    alert(act+'失败！');                                          
                }                          
             }
         })
     }
    
}
    </script>

    
    

</body>

</html>